package com.gateway.config;

import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

@Order(-10000)
@Component
public class TestFilter implements GlobalFilter {
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
//        System.out.println("请求进入过滤器");
//        ServerHttpRequest request = exchange.getRequest();
//        MultiValueMap<String, HttpCookie> cookies = request.getCookies();
//        Collection<List<HttpCookie>> values = cookies.values();
//        System.out.println(values);
        return chain.filter(exchange);
    }
}
